Calculation scenarios with semantic nodes

ABSTRACT

A calculation engine is described that executes calculation scenarios comprising a plurality of calculation nodes that each specify operations to be performed to execute the query. One of the nodes can be a semantic node that is used to modify the query for operations requiring special handling. Related apparatus, systems, methods, and articles are also described.

TECHNICAL FIELD

The subject matter described herein relates to the use of calculationscenarios with semantic nodes that provide special handling operationsfor queries.

BACKGROUND

Structured Query Language (SQL) is a common application programminginterface (API) for databases. SQL can be used by applications to accessreporting-views and extract the appropriate information. In most cases,data is read in an aggregated manner which means the SQL statementsissued by the applications contain a GROUP BY clause andaggregation-functions on keyfigures (e.g. sum,min,max).

The models/views used by the HANA applications are created by the SAPHANA Modeler. This is a tool beside the standard HANA Administrationconsole in eclipse (just a different perspective). As this tool isdecoupled from the HANA applications that display the data additionalmetadata information about the views (like ViewAttribute and Keyfigures)are stored in HANA tables that are read by such clients.

This concept gives the end-user the freedom to create a reporting-viewonce and consume it by different HANA applications. Due to this genericapproach the HANA applications do not have the ability and logic topost-process the extracted information. Therefore the HANA database mustprovide the correct result for all type of queries to guarantee acorrect handling in all HANA applications. In most of the case this isdone easily because the views and the SQL-queries behave relational likeit is defined in the SQL-standard but in some case the HANA databasemust handle the queries differently in order to provide thecorrect/expected result to the HANA applications. Typically thosespecial cases occur when more complex operations like ExceptionAggregation (Count Distinct), non-summable calculated keyfigures orcurrency conversion are used in the views. Now the challenge is to embedthe handling of these special cases into the given concept and theimplementation of the calculation engine.

SUMMARY

In one aspect, a database server receives a query from a remoteapplication server. The query is associated with a calculation scenariothat defines a data flow model that includes a plurality of calculationnodes. Each calculation node defines one or more operations to executeon the database server and at least one of the nodes is a semantic nodespecifying an operation requiring special handling. Thereafter, thedatabase server modifies the query using the semantic node andadditionally the calculation scenario based on the modified query. Themodified calculation scenario can then be instantiated by the databaseserver. The database server can then execute operations defined by thecalculation nodes of the modified calculation scenario to result in atleast one result set which can be provided to the application server.

The received query can specify an aggregation function on a calculatedattribute such that the special handling specified by the semantic nodeoverrides the aggregation function on the calculated attribute.

At least a portion of paths and/or attributes defined by the calculationscenario can, in some cases, not be not required to respond to thequery. In such cases, the instantiated calculation scenario omits thepaths and attributes defined by the calculation scenario that are notrequired to respond to the query.

At least one of the calculation nodes can filter results obtained fromthe database server. At least one of the calculation nodes can sortresults obtained from the database server. The calculation scenario canbe instantiated in a calculation engine layer by a calculation engine.The calculation engine layer can interact with a physical table pool anda logical layer. The physical table pool can include physical tablescontaining data to be queried, and the logical layer can define alogical metamodel joining at least a portion of the physical tables inthe physical table pool.

An input for each calculation node can include one or more of: aphysical index, a join index, an OLAP index, and another calculationnode. Each calculation node can have at least one output table that isused to generate the final result set. At least one calculation node canconsume an output table of another calculation node.

In some variations, the query can be forwarded to a calculation node inthe calculation scenario that is identified as a default node if thequery does not specify a calculation node at which the query should beexecuted.

The calculation scenario can include database metadata. The calculationscenario can be exposed as a database calculation view. In such cases, aSQL processor can invoke the calculation engine to execute thecalculation scenario behind the database calculation view. Thecalculation engine can invoke the SQL processor for executing setoperations. The SQL processor can invoke the calculation engine whenexecuting SQL queries with calculation views.

Computer program products are also described that comprisenon-transitory computer readable media storing instructions, which whenexecuted one or more data processors of one or more computing systems,causes at least one data processor to perform operations herein.Similarly, computer systems are also described that may include one ormore data processors and a memory coupled to the one or more dataprocessors. The memory may temporarily or permanently store instructionsthat cause at least one processor to perform one or more of theoperations described herein. In addition, methods can be implemented byone or more data processors either within a single computing system ordistributed among two or more computing systems. Such computing systemscan be connected and can exchange data and/or commands or otherinstructions or the like via one or more connections, including but notlimited to a connection over a network (e.g. the Internet, a wirelesswide area network, a local area network, a wide area network, a wirednetwork, or the like), via a direct connection between one or more ofthe multiple computing systems, etc.

The subject matter described herein provides many advantages. Forexample, the current subject matter provides a flexible, extendible, andpowerful approach for special query handling. In particular, the currentsubject matter can be used to ensure that database applications arealways provided with the correct result even if a special query-handlingis required.

The details of one or more variations of the subject matter describedherein are set forth in the accompanying drawings and the descriptionbelow. Other features and advantages of the subject matter describedherein will be apparent from the description and drawings, and from theclaims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a process flow diagram illustrating a method of processing aquery using a calculation scenario with a semantic node; and

FIG. 2 is a diagram illustrating a calculation engine layer, a logicallayer, a physical table pool and their interrelationship;

FIG. 3 is a diagram illustrating an architecture for processing andexecution control;

FIG. 4 is a diagram illustrating how a query can be defined in amodeler; and

FIG. 5 are diagrams illustrating a received query and a query asmodified using a semantic node of a corresponding calculation scenario.

DETAILED DESCRIPTION

With reference to diagram 100 of FIG. 1, at 110, a query is received bya database server from a remote application server. The query isassociated with a calculation scenario that defines a data flow modelthat includes a plurality of calculation nodes. Each calculation nodedefining one or more operations to execute on the database server and atleast one of the nodes is a semantic node specifying an operationrequiring special handling. Thereafter, at 120, the database servermodifies the query using the semantic node. In addition, at 130, thedatabase server modifies the calculation scenario based on the modifiedquery. The modified calculation scenario is, at 140, then instantiatedso that, at 150, the database server can execute the operations definedby the calculation nodes of the modified calculation scenario to resultin at least one result set. The at least one result set is then, at 160,provided by the database server to the application server.

The subject matter described herein can enable an application developerto define a data flow model to push down a high level algorithm to adatabase. A developer can define a calculation scenario which describesthis algorithm in a general way as data flow consisting of calculationnodes. A calculation node as used herein represents a operation such asa projection, aggregation, join, union, minus, intersection, and thelike. Additionally, as described below, in addition to a specifiedoperation, calculation nodes can sometimes be enhanced by filteringand/or sorting criteria. In some implementations, calculated attributescan also be added to calculation nodes.

During query time (i.e., the time in which a database is queried), thedata flow specified by a calculation scenario is instantiated. Duringinstantiation, the calculation scenario is compacted to only includequeries requirements by removing useless pathes and attributes (that arenot requested) within the calculation scenario. This compaction reducescalculation time and also minimizes the total amount of data that mustbe processed.

FIG. 2 is a diagram 200 that illustrates a database system in whichthere are three layers, a calculation engine layer 210, a logical layer220, and a physical table-pool 230. Calculation scenarios can beexecuted by a calculation engine which can form part of a database orwhich can be part of the calculation engine layer 210 (which isassociated with the database). The calculation engine layer 210 can bebased on and/or interact with the other two layers, the logical layer220 and the physical table pool 230. The basis of the physical tablepool 230 consists of physical tables (called indexes) containing thedata. Various tables can then be joined using logical metamodels definedby the logical layer 220 to form a new index. For example, the tables ina cube (OLAP view) can be assigned roles (e.g., fact or dimensiontables) and joined to form a star schema. It is also possible to formjoin indexes, which can act like database view in environments such asthe Fast Search Infrastructure (FSI) by SAP AG.

As stated above, calculation scenarios can include individualcalculation nodes 211-214, which in turn each define operations such asjoining various physical or logical indexes and other calculation nodes(e.g., CView 4 is a join of CView 2 and CView 3). That is, the input fora calculation node 211-214 can be one or more physical, join, or OLAPviews or calculation nodes.

In calculation scenarios, two different representations can be provided.First, a pure calculation scenario in which all possible attributes aregiven. Second, an instantiated model that contains only the attributesrequested in the query (and required for further calculations). Thus,calculation scenarios can be created that can be used for variousqueries. With such an arrangement, calculation scenarios can be createdwhich can be reused by multiple queries even if such queries do notrequire every attribute specified by the calculation scenario.

Every calculation scenario can be uniquely identifiable by a name (i.e.,the calculation scenario can be a database object with a uniqueidentifier, etc.). This means, that the calculation scenario can bequeried in a manner similar to a view in a SQL database. Thus, the queryis forwarded to the calculation node 211-214 for the calculationscenario that is marked as the corresponding default node. In addition,a query can be executed on a particular calculation node 211-214 (asspecified in the query). Furthermore, nested calculation scenarios canbe generated in which one calculation scenario is used as source inanother calculation scenario (via a calculation node 211-214 in thiscalculation scenario). Each calculation node 211-214 can have one ormore output tables. One output table can be consumed by severalcalculation nodes 211-214.

Further details regarding calculation engine architecture andcalculation scenarios can be found in U.S. Pat. No. 8,195,643, thecontents of which are hereby fully incorporated by reference.

FIG. 3 is a diagram 300 illustrating a sample architecture for requestprocessing and execution control. As shown in FIG. 3, artifacts 305 indifferent domain specific languages can be translated by their specificcompilers 310 into a common representation called a “calculationscenario” 315 (illustrated as a calculation model). To achieve enhancedperformance, the models and programs written in these languages areexecuted inside the database server. This arrangement eliminates theneed to transfer large amounts of data between the database server andthe client application. Once the different artifacts 305 are compiledinto this calculation scenario 315, they can be processed and executedin the same manner. The execution of the calculation scenarios 315 isthe task of a calculation engine 320.

The calculation scenario 315 can be a directed acyclic graph with arrowsrepresenting data flows and nodes that represent operations. Eachcalculation node has a set of inputs and outputs and an operation thattransforms the inputs into the outputs. In addition to their primaryoperation, each calculation node can also have a filter condition forfiltering the result set. The inputs and the outputs of the operationscan be table valued parameters (i.e., user-defined table types that arepassed into a procedure or function and provide an efficient way to passmultiple rows of data to the application server). Inputs can beconnected to tables or to the outputs of other calculation nodes.Calculation scenarios 315 can support a variety of node types such as(i) nodes for set operations such as projection, aggregation, join,union, minus, intersection, and (ii) SQL nodes that execute a SQLstatement which is an attribute of the node. In addition, to enableparallel execution, a calculation scenario 315 can contain split andmerge operations. A split operation can be used to partition inputtables for subsequent processing steps based on partitioning criteria.Operations between the split and merge operation can then be executed inparallel for the different partitions. Parallel execution can also beperformed without split and merge operation such that all nodes on onelevel can be executed in parallel until the next synchronization point.Split and merge allows for enhanced/automatically generatedparallelization. If a user knows that the operations between the splitand merge can work on portioned data without changing the result he orshe can use a split. Then, the nodes can be automatically multipliedbetween split and merge and partition the data.

A calculation scenario 315 can be defined as part of database metadataand invoked multiple times. A calculation scenario 315 can be created,for example, by a SQL statement “CREATE CALCULATION SCENARIO <NAME>USING <XML or JSON>”. Once a calculation scenario 315 is created, it canbe queried (e.g., “SELECT A, B, C FROM <scenario name>”, etc.). In somecases, databases can have pre-defined calculation scenarios 315(default, previously defined by users, etc.). The calculation scenarios315 can be persisted in a repository (coupled to the database server) orin transient scenarios, the calculation scenarios 315 can be keptin-memory.

Calculation scenarios 315 are more powerful than traditional SQL queriesor SQL views for many reasons. One reason is the possibility to defineparameterized calculation schemas that are specialized when the actualquery is issued. Unlike a SQL view, a calculation scenario 315 does notdescribe the actual query to be executed. Rather, it describes thestructure of the calculation. Further information is supplied when thecalculation scenario is executed. This further information can includeparameters that represent values (for example in filter conditions). Toobtain more flexibility, it is also possible to refine the operationswhen the model is invoked. For example, at definition time, thecalculation scenario 315 may contain an aggregation node containing allattributes. Later, the attributes for grouping can be supplied with thequery. This allows having a predefined generic aggregation, with theactual aggregation dimensions supplied at invocation time. Thecalculation engine 320 can use the actual parameters, attribute list,grouping attributes, and the like supplied with the invocation toinstantiate a query specific calculation scenario 315. This instantiatedcalculation scenario 315 is optimized for the actual query and does notcontain attributes, nodes or data flows that are not needed for thespecific invocation.

When the calculation engine 320 gets a request to execute a calculationscenario 315, it can first optimize the calculation scenario 315 using arule based model optimizer 322. Examples for optimizations performed bythe model optimizer can include “pushing down” filters and projectionsso that intermediate results 326 are narrowed down earlier, or thecombination of multiple aggregation and join operations into one node.The optimized model can then be executed by a calculation engine modelexecutor 324 (a similar or the same model executor can be used by thedatabase directly in some cases). This includes decisions about parallelexecution of operations in the calculation scenario 315. The modelexecutor 324 can invoke the required operators (using, for example, acalculation engine operators module 328) and manage intermediateresults. Most of the operators are executed directly in the calculationengine 320 (e.g., creating the union of several intermediate results).The remaining nodes of the calculation scenario 315 (not implemented inthe calculation engine 320) can be transformed by the model executor 324into a set of logical database execution plans. Multiple set operationnodes can be combined into one logical database execution plan ifpossible.

The calculation scenarios 315 of the calculation engine 320 can beexposed as a special type of database views called calculation views.That means a calculation view can be used in SQL queries and calculationviews can be combined with tables and standard views using joins and subqueries. When such a query is executed, the database executor inside theSQL processor needs to invoke the calculation engine 320 to execute thecalculation scenario 315 behind the calculation view. In someimplementations, the calculation engine 320 and the SQL processor arecalling each other: on one hand the calculation engine 320 invokes theSQL processor for executing set operations and SQL nodes and, on theother hand, the SQL processor invokes the calculation engine 320 whenexecuting SQL queries with calculation views.

The attributes of the incoming datasets utilized by the rules of modeloptimizer 322 can additionally or alternatively be based on an estimatedand/or actual amount of memory consumed by the dataset, a number of rowsand/or columns in the dataset, and the number of cell values for thedataset, and the like.

Calculation scenarios as described herein can include a new type of nodereferred to herein as a semantic node (or sometimes semantic root node).A database modeler can flag the root node (output) in a graphicalcalculation view to which the queries of the database applicationsdirected as semantic node. This arrangement allows the calculationengine 320 to easily identify those queries and provide a properhandling of query in all cases.

In calculation views of a database modeler, it can be possible to createcalculated keyfigures at the semantic node that are not summable (e.g.,expressions such as “keyfigure A” divided by “keyfigure B” or “keyfigureA” plus a constant value, etc). Those formulas can have differentresults depending at which aggregation level the formula is evaluated.In most cases, the correct/expected result is obtained when formulas arecalculated at latest possible instance within the nodal hierarchy.

The current subject matter can help address those situations in whichgeneric metadata information provided by the database to the databaseapplication(s) does not contain such highly specified information, andadditionally most of consumer/developer of the database application donot have a complete understanding of such semantics. Hence the databaseapplication treats aggregation operations involving such a keyfigurelike every standard keyfigure even though this might result in anincorrect result set. However, with the use of the semantic node, thecalculation engine 320 knows about the different semantic and changesthe query (which in turn requires the calculation scenario to bemodified) in a way that it creates the correct results.

As stated above, the semantic node can be the top most node in acalculation scenario. If the top node in a calculation node is anaggregating node, the calculation engine 320 can distinguish betweenkeyfigures/measures which have an aggregation function like SUM, MIN,MAX, . . . and the ViewAttributes which forms the GROUP BY.

Here is an example:

COUNTRY CITY SALES (Keyfigure (ViewAttribute) (ViewAttribute) SUM) US NY1000 US LA 2000 GER WDF 500 GER B 500

If the top node is an aggregation with keyfigure SALES (aggregationfunction SUM) then a SELECT SALES, COUNTRY FROM MY_CALCSCEN will return:

COUNTRY SALES US 3000 GER 1000

This is equivalent to the query: SELECT sum(SALES), COUNTRY FROMMY_CALCSCEN because the sum( ) is already defined in the calculationscenario.

Assume that the calculation scenario is queried with SELECT MIN(SALES),COUNTRY FROM MY_CALCSCEN, the result would be the same.

COUNTRY SALES US 3000 GER 1000

Because the query in SQL would be:

SELECT min(SALES), COUNTRY FROM (SELECT sum(SALES), COUNTRY FROMMY_CALCSCEN). So first SALES is summed up and afterwards min( ) isapplied which does not change the result anymore.

The semantic node now has the task to overwrite the aggregation function(by modifying the query and using the modified query to modify thecalculation scenario) from to top most node of with the query anaggregation function is provided:

-   -   SELECT SALES, COUNTRY FROM MY_CALCSCEN will return [assuming        default aggregation type is specified with sum( )]:

COUNTRY SALES US 3000 GER 1000

-   -   SELECT sum(SALES), COUNTRY FROM MY_CALCSCEN will return:

COUNTRY SALES US 3000 GER 1000

-   -   SELECT min(SALES). COUNTRY FROM MY_CALCSCEN will return:

COUNTRY SALES US 1000 GER 500

With reference to diagram 400 of FIG. 4, a database modeler can specifythat a semantic node of a calculation scenario can provide thefollowing:

ViewAttritbute: A,B

Keyfigure: SUM(C) as C,SUM(D) as D

Calculated Keyfigure: C*D as CALC

A query specified by a database application (see diagram 500A of FIG. 5)can be as follows:

SELECT A, SUM(CALC) as CALC FROM <calcview> GROUP BY A

With regard to the above <calcview> can be characterized as aplaceholder such as MY_CALCSEN in the examples above.

The specified query, using the semantic node, is modified (see diagram500B of FIG. 5) by the calculation engine 320 will be as follows (whichwill result in the corresponding calculation scenario beingcorrespondingly modified):

SELECT A, sum(C)*sum(D) as CALC FROM <calcview> GROUP BY A

With further reference to 500B, because the upper node is switched toprojection as operation, the attribute CALC can also be characterized asa view attribute. Keyfigures can, in some implementations, only beallowed on operation nodes that aggregate somehow, on all other nodesthey can be handled as view attributes.

The current subject matter can be used to hide such complex operations(essential for analytic reporting) by using the semantic node in thedatabase and to automatically provide the expected result to the userwithout having to specify such complex operations. Stated differently,the semantic node can be used to override an aggregation functionpre-defined by the query. Additionally the function of the semantic nodecan be bound to a specific area of operation like business warehouse(BW), SAP PlanningScenarios, or SAP MDX. So a semantic node in a BWscenario can allow for overwriting of aggregation functions ofkeyfigures but not in MDX scenarios. The advantage of the currentapproach is that the logic can be implemented once within the databaseand can be consumable by every database application. Further, the use ofa semantic node as described herein provides enhanced usability as deepknowledge of modeling is not required. Additionally, such approachscales very well because such complex logic need not be distributed tobroad audiences.

One or more aspects or features of the subject matter described hereinmay be realized in digital electronic circuitry, integrated circuitry,specially designed ASICs (application specific integrated circuits),computer hardware, firmware, software, and/or combinations thereof.These various implementations may include implementation in one or morecomputer programs that are executable and/or interpretable on aprogrammable system including at least one programmable processor, whichmay be special or general purpose, coupled to receive data andinstructions from, and to transmit data and instructions to, a storagesystem, at least one input device (e.g., mouse, touch screen, etc.), andat least one output device.

These computer programs, which can also be referred to as programs,software, software applications, applications, components, or code,include machine instructions for a programmable processor, and can beimplemented in a high-level procedural language, an object-orientedprogramming language, a functional programming language, a logicalprogramming language, and/or in assembly/machine language. As usedherein, the term “machine-readable medium” refers to any computerprogram product, apparatus and/or device, such as for example magneticdiscs, optical disks, memory, and Programmable Logic Devices (PLDs),used to provide machine instructions and/or data to a programmableprocessor, including a machine-readable medium that receives machineinstructions as a machine-readable signal. The term “machine-readablesignal” refers to any signal used to provide machine instructions and/ordata to a programmable processor. The machine-readable medium can storesuch machine instructions non-transitorily, such as for example as woulda non-transient solid state memory or a magnetic hard drive or anyequivalent storage medium. The machine-readable medium can alternativelyor additionally store such machine instructions in a transient manner,such as for example as would a processor cache or other random accessmemory associated with one or more physical processor cores.

To provide for interaction with a user, the subject matter describedherein can be implemented on a computer having a display device, such asfor example a cathode ray tube (CRT) or a liquid crystal display (LCD)monitor for displaying information to the user and a keyboard and apointing device, such as for example a mouse or a trackball, by whichthe user may provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well. For example,feedback provided to the user can be any form of sensory feedback, suchas for example visual feedback, auditory feedback, or tactile feedback;and input from the user may be received in any form, including, but notlimited to, acoustic, speech, or tactile input. Other possible inputdevices include, but are not limited to, touch screens or othertouch-sensitive devices such as single or multi-point resistive orcapacitive trackpads, voice recognition hardware and software, opticalscanners, optical pointers, digital image capture devices and associatedinterpretation software, and the like.

The subject matter described herein may be implemented in a computingsystem that includes a back-end component (e.g., as a data server), orthat includes a middleware component (e.g., an application server), orthat includes a front-end component (e.g., a client computer having agraphical user interface or a Web browser through which a user mayinteract with an implementation of the subject matter described herein),or any combination of such back-end, middleware, or front-endcomponents. The components of the system may be interconnected by anyform or medium of digital data communication (e.g., a communicationnetwork). Examples of communication networks include a local areanetwork (“LAN”), a wide area network (“WAN”), and the Internet.

The computing system may include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.

The subject matter described herein can be embodied in systems,apparatus, methods, and/or articles depending on the desiredconfiguration. The implementations set forth in the foregoingdescription do not represent all implementations consistent with thesubject matter described herein. Instead, they are merely some examplesconsistent with aspects related to the described subject matter.Although a few variations have been described in detail above, othermodifications or additions are possible. In particular, further featuresand/or variations can be provided in addition to those set forth herein.For example, the implementations described above can be directed tovarious combinations and subcombinations of the disclosed featuresand/or combinations and subcombinations of several further featuresdisclosed above. In addition, the logic flow(s) depicted in theaccompanying figures and/or described herein do not necessarily requirethe particular order shown, or sequential order, to achieve desirableresults. Other implementations may be within the scope of the followingclaims.

What is claimed is:
 1. A method comprising: receiving, by a databaseserver from a remote application server, a query associated with acalculation scenario that defines a data flow model that includes aplurality of calculation nodes, each calculation node defining one ormore operations to execute on the database server, at least one of thenodes being a semantic node specifying an operation requiring specialhandling; modifying, by the database server, the query using thesemantic node; modifying, by the database server, the calculationscenario based on the modified query; instantiating, by the databaseserver, the modified calculation scenario; executing, by the databaseserver, the operations defined by the calculation nodes of the modifiedcalculation scenario to result in at least one result set; andproviding, by the database server to the application server, the atleast one result set; wherein the received query specifies anaggregation function on a calculated attribute, and wherein the specialhandling specified by the semantic node overrides the aggregationfunction on the calculated attribute to a projection operation.
 2. Amethod as in claim 1, wherein at least a portion of paths and/orattributes defined by the calculation scenario are not required torespond to the query, and wherein the instantiated calculation scenarioomits the paths and attributes defined by the calculation scenario thatare not required to respond to the query.
 3. A method as in claim 1,wherein at least one of the calculation nodes filters results obtainedfrom the database server.
 4. A method as in claim 1, wherein at leastone of the calculation nodes sorts results obtained from the databaseserver.
 5. A method as in claim 1, wherein the calculation scenario isinstantiated in a calculation engine layer by a calculation engine.
 6. Amethod as in claim 5, wherein the calculation engine layer interactswith a physical table pool and a logical layer, the physical table poolcomprising physical tables containing data to be queried, and thelogical layer defining a logical metamodel joining at least a portion ofthe physical tables in the physical table pool.
 7. A method as in claim1, wherein an input for each calculation node comprises one or more of:a physical index, a join index, an OLAP index, and another calculationnode.
 8. A method as in claim 7, wherein each calculation node has atleast one output table that is used to generate the final result set. 9.A method as in claim 8, wherein at least one calculation node consumesan output table of another calculation node.
 10. A method as in claim 1,wherein the executing comprises: forwarding the query to a calculationnode in the calculation scenario that is identified as a default node ifthe query does not specify a calculation node at which the query shouldbe executed.
 11. A method as in claim 1, wherein the query identifies aparticular calculation node, and wherein the executing comprises:forwarding the query to the calculation node specified in the query atwhich the query should be executed.
 12. A method as in claim 1, whereinthe calculation scenario comprises database metadata.
 13. A method as inclaim 1, wherein the calculation scenario is exposed as a databasecalculation view.
 14. A method as in claim 13, wherein the executingcomprises: invoking, by a SQL processor, a calculation engine to executethe calculation scenario behind the database calculation view.
 15. Amethod as in claim 14, wherein the calculation engine invokes the SQLprocessor for executing set operations.
 16. A method as in claim 15,wherein the SQL processor invokes the calculation engine when executingSQL queries with calculation views.
 17. A non-transitory computerprogram product storing instructions, which when executed by at leastone data processor, result in operations comprising: receiving a queryassociated with a calculation scenario that defines a data flow modelthat includes a plurality of calculation nodes, each calculation nodedefining one or more operations to execute on the database server, atleast one of the nodes being a semantic node specifying an operationrequiring special handling; modifying the query using the semantic node;modifying the calculation scenario based on the modified query;instantiating the modified calculation scenario; executing theoperations defined by the calculation nodes of the modified calculationscenario to result in at least one result set; and providing the atleast one result set; wherein the received query specifies anaggregation function on a calculated attribute, and wherein the specialhandling specified by the semantic node overrides the aggregationfunction on the calculated attribute to a projection operation.
 18. Asystem comprising: a database server; and an application server remotefrom the database server; wherein the database server: receives a queryassociated with a calculation scenario that defines a data flow modelthat includes a plurality of calculation nodes, each calculation nodedefining one or more operations to execute on the database server, atleast one of the nodes being a semantic node specifying an operationrequiring special handling; modifies the query using the semantic node;modifies the calculation scenario based on the modified query;instantiates the modified calculation scenario; executes the operationsdefined by the calculation nodes of the modified calculation scenario toresult in at least one result set; and provides the at least one resultset; wherein the received query specifies an aggregation function on acalculated attribute, and wherein the special handling specified by thesemantic node overrides the aggregation function on the calculatedattribute to a projection operation.
 19. A system as in claim 18,wherein at least a portion of paths and/or attributes defined by thecalculation scenario are not required to respond to the query, andwherein the instantiated calculation scenario omits the paths andattributes defined by the calculation scenario that are not required torespond to the query.
 20. A system as in claim 18, wherein at least oneof the calculation nodes filters results obtained from the databaseserver.
 21. A system as in claim 18, wherein at least one of thecalculation nodes sorts results obtained from the database server.
 22. Asystem as in claim 18, wherein the calculation scenario is instantiatedin a calculation engine layer by a calculation engine.
 23. A system asin claim 22, wherein the calculation engine layer interacts with aphysical table pool and a logical layer, the physical table poolcomprising physical tables containing data to be queried, and thelogical layer defining a logical metamodel joining at least a portion ofthe physical tables in the physical table pool.
 24. A system as in claim18, wherein an input for each calculation node comprises one or more of:a physical index, a join index, an OLAP index, and another calculationnode.
 25. A system as in claim 24, wherein each calculation node has atleast one output table that is used to generate the final result set.26. A system as in claim 25, wherein at least one calculation nodeconsumes an output table of another calculation node.
 27. A system as inclaim 18, wherein the executing comprises: forwarding the query to acalculation node in the calculation scenario that is identified as adefault node if the query does not specify a calculation node at whichthe query should be executed.
 28. A system as in claim 18, wherein thequery identifies a particular calculation node, and wherein theexecuting comprises: forwarding the query to the calculation nodespecified in the query at which the query should be executed.
 29. Asystem as in claim 18, wherein the calculation scenario comprisesdatabase metadata.
 30. A system as in claim 18, wherein the calculationscenario is exposed as a database calculation view.
 31. A system as inclaim 30, wherein the executing comprises: invoking, by a SQL processor,a calculation engine to execute the calculation scenario behind thedatabase calculation view.
 32. A system as in claim 31, wherein thecalculation engine invokes the SQL processor for executing setoperations.
 33. A system as in claim 31 wherein the SQL processorinvokes the calculation engine when executing SQL queries withcalculation views.